<script setup>

import { ref } from "vue";

const aPoiSearchOptions = ref([])
const bPoiSearchLoading = ref(false);
const sPoiSearch = ref('');

const fnPoiSearchChange = (value) => {

}

const fnRemoteMethod = (query) => {
  console.log(query,'query')
}

const props = defineProps({
  AMap:{
    type: Object,
  }
})

const fnLoadPlugins = ()=>{
  AMap.value.plugin(['AMap.PlaceSearch', 'AMap.ToolBar'], ()=> {

  })
}
</script>

<template>

  <div class="g-poi-search">
    <el-select
      v-model="sPoiSearch"
      filterable
      remote
      reserve-keyword
      placeholder="请输入地名"
      :no-data-text="'查询失败，请输入正确地名'"
      :popper-class="'g-poi-search-popper'"
      :remote-method="fnRemoteMethod"
      :loading="bPoiSearchLoading"
      @change="fnPoiSearchChange">
      <el-option
        v-for="item in aPoiSearchOptions"
        :key="item.value"
        :label="item.label"
        :title="item.label"
        :value="item.value">
      </el-option>
    </el-select>
  </div>

</template>

<style scoped>

</style>